@tailwind base;
@tailwind components;
@tailwind utilities;

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700;800&family=Noto+Serif+SC:wght@400;500;600;700&family=Ma+Shan+Zheng&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

@layer base {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    scroll-behavior: smooth;
    font-size: 16px;
  }
  
  body {
    font-family: 'Noto Serif SC', 'SimSun', '宋体', serif;
    background: #1A1A1A;
    background-attachment: fixed;
    color: #FFFFFF;
    overflow-x: hidden;
    line-height: 1.8;
    font-weight: 400;
  }
  
  /* 自定义滚动条 */
  ::-webkit-scrollbar {
    width: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
  }
  
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #B8866B, #6B8E9B);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #9A6B4B, #5A7A8B);
  }
}

@layer components {
  /* 京剧主题渐变 - 朱红石青墨黑 */
  /* 淡雅页面主题颜色系统 */
  .theme-home {
    background: linear-gradient(135deg, #2C2C2C 0%, #B8866B 15%, #2C2C2C 100%);
  }
  
  .theme-ai {
    background: linear-gradient(135deg, #2C2C2C 0%, #6B8E9B 15%, #2C2C2C 100%);
  }
  
  .theme-interactive {
    background: linear-gradient(135deg, #2C2C2C 0%, #D4B896 15%, #2C2C2C 100%);
  }
  
  .theme-community {
    background: linear-gradient(135deg, #2C2C2C 0%, #A8C8B8 15%, #2C2C2C 100%);
  }
  
  .theme-creator {
    background: linear-gradient(135deg, #2C2C2C 0%, #5A6B7A 15%, #2C2C2C 100%);
  }
  
  .jing-gradient {
    background: linear-gradient(135deg, #B8866B 0%, #6B8E9B 50%, #D4B896 100%);
    position: relative;
    overflow: hidden;
  }
  
  .jing-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
  }
  
  .jing-text-gradient {
    background: linear-gradient(135deg, #B8866B 0%, #6B8E9B 50%, #D4B896 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
  }
  
  /* 玻璃拟态效果增强 - 京剧色彩 */
  .glass-effect {
    background: rgba(184, 134, 107, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(184, 134, 107, 0.2);
    box-shadow: 0 8px 32px rgba(44, 44, 44, 0.5);
  }
  
  .glass-effect-strong {
    background: rgba(184, 134, 107, 0.15);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(184, 134, 107, 0.3);
    box-shadow: 0 12px 40px rgba(44, 44, 44, 0.6);
  }
  
  /* 卡片组件增强 */
  .jing-card {
    @apply glass-effect rounded-2xl p-8 shadow-2xl transition-all duration-500 hover:shadow-jing-red/30 hover:scale-105 hover:glass-effect-strong;
    position: relative;
    overflow: hidden;
  }
  
  .jing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
  }
  
  .jing-card:hover::before {
    left: 100%;
  }
  
  /* 按钮组件增强 - 京剧色彩 */
  .jing-button {
    @apply bg-gradient-to-r from-zhu-hong via-shi-qing to-jing-gold text-jing-white font-semibold px-8 py-4 rounded-xl transition-all duration-300 hover:shadow-2xl hover:shadow-zhu-hong/40 transform hover:scale-110 hover:-translate-y-1;
    position: relative;
    overflow: hidden;
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
  }
  
  .jing-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
  }
  
  .jing-button:hover::before {
    left: 100%;
  }
  
  /* 输入框增强 - 京剧色彩 */
  .jing-input {
    @apply bg-zhu-hong/10 border border-zhu-hong/20 rounded-xl px-6 py-4 text-jing-white placeholder-jing-white/60 focus:outline-none focus:border-zhu-hong focus:ring-2 focus:ring-zhu-hong/30 transition-all duration-300;
    backdrop-filter: blur(10px);
  }
  
  .jing-input:focus {
    background: rgba(196, 30, 58, 0.15);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.3);
  }
  
  /* 京剧脸谱装饰 - 朱红石青墨黑 */
  .jing-mask {
    background: radial-gradient(circle at 30% 30%, #C41E3A 0%, #A0172E 30%, #2E8B57 70%, #1A1A1A 100%);
    border-radius: 50%;
    position: relative;
  }
  
  .jing-mask::before {
    content: '🎭';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
  }
  
  /* 字体系统 - 隶书和宋体 */
  .jing-title {
    font-family: 'STLiti', 'LiSu', '隶书', 'Noto Serif SC', serif;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    font-size: 1.2em;
  }
  
  .jing-subtitle {
    font-family: 'STLiti', 'LiSu', '隶书', 'Noto Serif SC', serif;
    font-weight: 500;
    letter-spacing: 0.1em;
    font-size: 1.1em;
  }
  
  .jing-nav {
    font-family: 'STLiti', 'LiSu', '隶书', 'Noto Serif SC', serif;
    font-weight: 500;
    letter-spacing: 0.08em;
  }
  
  .jing-content {
    font-family: 'Noto Serif SC', 'SimSun', '宋体', serif;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.02em;
  }
  
  .jing-reading {
    font-family: 'Noto Serif SC', 'SimSun', '宋体', serif;
    font-weight: 400;
    line-height: 2.0;
    letter-spacing: 0.03em;
    font-size: 1.05em;
  }
  
  /* 字体层次优化 */
  .jing-heading-1 {
    font-family: 'STLiti', 'LiSu', '隶书', 'Noto Serif SC', serif;
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    line-height: 1.2;
  }
  
  .jing-heading-2 {
    font-family: 'STLiti', 'LiSu', '隶书', 'Noto Serif SC', serif;
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    line-height: 1.3;
  }
  
  .jing-heading-3 {
    font-family: 'STLiti', 'LiSu', '隶书', 'Noto Serif SC', serif;
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.4;
  }
  
  .jing-body-large {
    font-family: 'Noto Serif SC', 'SimSun', '宋体', serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.02em;
  }
  
  .jing-body {
    font-family: 'Noto Serif SC', 'SimSun', '宋体', serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
  }
  
  .jing-caption {
    font-family: 'Noto Serif SC', 'SimSun', '宋体', serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
  }
  
  /* 传统戏曲图案系统 */
  .opera-pattern {
    position: relative;
    overflow: hidden;
  }
  
  .opera-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      radial-gradient(circle at 20% 20%, rgba(196, 30, 58, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(46, 139, 87, 0.1) 0%, transparent 50%),
      linear-gradient(45deg, transparent 30%, rgba(218, 165, 32, 0.05) 50%, transparent 70%);
    pointer-events: none;
  }
  
  /* 京剧脸谱图案 */
  .jing-mask-pattern {
    background: 
      radial-gradient(ellipse at 30% 20%, rgba(196, 30, 58, 0.15) 0%, transparent 60%),
      radial-gradient(ellipse at 70% 80%, rgba(46, 139, 87, 0.15) 0%, transparent 60%),
      linear-gradient(135deg, rgba(218, 165, 32, 0.1) 0%, transparent 50%);
    position: relative;
  }
  
  .jing-mask-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C41E3A' fill-opacity='0.05'%3E%3Cpath d='M30 30c0-11.046-8.954-20-20-20s-20 8.954-20 20 8.954 20 20 20 20-8.954 20-20zm0 0c0 11.046 8.954 20 20 20s20-8.954 20-20-8.954-20-20-20-20 8.954-20 20z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
  }
  
  /* 云纹图案 */
  .cloud-pattern {
    background-image: 
      url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232E8B57' fill-opacity='0.08'%3E%3Cpath d='M50 20c-16.569 0-30 13.431-30 30 0 5.523 1.5 10.7 4.1 15.2C15.2 67.8 10 75.4 10 84c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16 0-8.6-5.2-16.2-14.1-18.8C87.5 60.7 89 55.523 89 50c0-16.569-13.431-30-30-30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: 200px 200px;
    background-position: 0 0, 100px 100px;
    background-repeat: repeat;
  }
  
  /* 水波纹图案 */
  .wave-pattern {
    background-image: 
      url("data:image/svg+xml,%3Csvg width='120' height='60' viewBox='0 0 120 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23DAA520' fill-opacity='0.1'%3E%3Cpath d='M0 30c20-20 40-20 60 0s40 20 60 0v30H0V30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: 240px 120px;
    background-repeat: repeat-x;
  }
  
  /* 梅花图案 */
  .plum-pattern {
    background-image: 
      url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C41E3A' fill-opacity='0.06'%3E%3Cpath d='M40 10c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10zm0 20c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10zm0 20c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: 160px 160px;
    background-position: 0 0, 80px 80px;
    background-repeat: repeat;
  }
  
  /* 国潮装饰边框 */
  .guochao-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(45deg, #C41E3A, #2E8B57, #DAA520) border-box;
    border-radius: 12px;
  }
  
  .guochao-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #C41E3A, #2E8B57, #DAA520);
    border-radius: 12px;
    z-index: -1;
  }
  
  /* 传统纹样装饰 */
  .traditional-ornament {
    position: relative;
  }
  
  .traditional-ornament::before,
  .traditional-ornament::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #C41E3A, #2E8B57);
    border-radius: 50%;
    opacity: 0.6;
  }
  
  .traditional-ornament::before {
    top: -10px;
    left: -10px;
  }
  
  .traditional-ornament::after {
    bottom: -10px;
    right: -10px;
  }
  
  /* 国潮动画效果 */
  .guochao-glow {
    position: relative;
    overflow: hidden;
  }
  
  .guochao-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(196, 30, 58, 0.1), transparent);
    animation: guochaoRotate 4s linear infinite;
    pointer-events: none;
  }
  
  @keyframes guochaoRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* 传统纹样动画 */
  .traditional-flow {
    background: linear-gradient(45deg, #C41E3A, #2E8B57, #DAA520, #C41E3A);
    background-size: 400% 400%;
    animation: traditionalFlow 8s ease-in-out infinite;
  }
  
  @keyframes traditionalFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }
  
  /* 戏曲图案呼吸效果 */
  .opera-breathe {
    animation: operaBreathe 3s ease-in-out infinite;
  }
  
  @keyframes operaBreathe {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.8; }
  }
  
  /* 国潮渐变边框动画 */
  .guochao-border-animated {
    position: relative;
    background: linear-gradient(45deg, #C41E3A, #2E8B57, #DAA520, #C41E3A);
    background-size: 400% 400%;
    animation: traditionalFlow 6s ease-in-out infinite;
    padding: 2px;
    border-radius: 12px;
  }
  
  .guochao-border-animated::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: #1A1A1A;
    border-radius: 10px;
    z-index: -1;
  }
  
  /* 传统装饰线条动画 */
  .traditional-line-animated {
    position: relative;
    overflow: hidden;
  }
  
  .traditional-line-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(218, 165, 32, 0.6), transparent);
    animation: traditionalLineFlow 2s ease-in-out infinite;
  }
  
  @keyframes traditionalLineFlow {
    0% { left: -100%; }
    100% { left: 100%; }
  }
  
  /* 京剧脸谱旋转效果 */
  .jing-mask-rotate {
    animation: jingMaskRotate 10s linear infinite;
  }
  
  @keyframes jingMaskRotate {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
  }
  
  /* 云纹飘动效果 */
  .cloud-float {
    animation: cloudFloat 20s ease-in-out infinite;
  }
  
  @keyframes cloudFloat {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(20px) translateY(-10px); }
    50% { transform: translateX(0) translateY(-20px); }
    75% { transform: translateX(-20px) translateY(-10px); }
  }
  
  /* 水波纹流动效果 */
  .wave-flow {
    animation: waveFlow 15s linear infinite;
  }
  
  @keyframes waveFlow {
    0% { background-position: 0 0; }
    100% { background-position: 240px 0; }
  }
  
  /* 梅花飘落效果 */
  .plum-fall {
    animation: plumFall 25s linear infinite;
  }
  
  @keyframes plumFall {
    0% { background-position: 0 0; }
    100% { background-position: 160px 160px; }
  }
  
  /* 京剧优美动作动画 */
  .opera-gesture {
    animation: operaGesture 6s ease-in-out infinite;
  }
  
  @keyframes operaGesture {
    0%, 100% { 
      transform: translateY(0) rotate(0deg) scale(1);
      opacity: 0.8;
    }
    25% { 
      transform: translateY(-10px) rotate(2deg) scale(1.05);
      opacity: 1;
    }
    50% { 
      transform: translateY(-5px) rotate(-1deg) scale(1.1);
      opacity: 0.9;
    }
    75% { 
      transform: translateY(-15px) rotate(1deg) scale(1.02);
      opacity: 1;
    }
  }
  
  /* 京剧水袖动作 */
  .opera-sleeve {
    animation: operaSleeve 4s ease-in-out infinite;
  }
  
  @keyframes operaSleeve {
    0%, 100% { 
      transform: rotate(0deg) translateX(0);
    }
    25% { 
      transform: rotate(15deg) translateX(5px);
    }
    50% { 
      transform: rotate(-10deg) translateX(-3px);
    }
    75% { 
      transform: rotate(8deg) translateX(2px);
    }
  }
  
  /* 京剧转身动作 */
  .opera-turn {
    animation: operaTurn 8s ease-in-out infinite;
  }
  
  @keyframes operaTurn {
    0%, 100% { 
      transform: rotate(0deg) scale(1);
    }
    25% { 
      transform: rotate(90deg) scale(1.05);
    }
    50% { 
      transform: rotate(180deg) scale(1.1);
    }
    75% { 
      transform: rotate(270deg) scale(1.05);
    }
  }
  
  /* 京剧亮相动作 */
  .opera-pose {
    animation: operaPose 5s ease-in-out infinite;
  }
  
  @keyframes operaPose {
    0%, 100% { 
      transform: translateY(0) scale(1);
      opacity: 0.7;
    }
    20% { 
      transform: translateY(-8px) scale(1.08);
      opacity: 1;
    }
    40% { 
      transform: translateY(-12px) scale(1.12);
      opacity: 0.9;
    }
    60% { 
      transform: translateY(-6px) scale(1.05);
      opacity: 1;
    }
    80% { 
      transform: translateY(-10px) scale(1.1);
      opacity: 0.8;
    }
  }
  
  /* 京剧步法动作 */
  .opera-step {
    animation: operaStep 3s ease-in-out infinite;
  }
  
  @keyframes operaStep {
    0%, 100% { 
      transform: translateX(0) translateY(0);
    }
    25% { 
      transform: translateX(5px) translateY(-3px);
    }
    50% { 
      transform: translateX(0) translateY(-6px);
    }
    75% { 
      transform: translateX(-5px) translateY(-3px);
    }
  }
  
  /* 京剧手部动作 */
  .opera-hand {
    animation: operaHand 4s ease-in-out infinite;
  }
  
  @keyframes operaHand {
    0%, 100% { 
      transform: rotate(0deg) scale(1);
    }
    25% { 
      transform: rotate(10deg) scale(1.1);
    }
    50% { 
      transform: rotate(-5deg) scale(1.05);
    }
    75% { 
      transform: rotate(8deg) scale(1.08);
    }
  }
}

@layer utilities {
  .text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  
  .text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  }
  
  .text-shadow-xl {
    text-shadow: 0 8px 16px rgba(0, 0, 0, 0.7);
  }
  
  .animation-delay-200 {
    animation-delay: 200ms;
  }
  
  .animation-delay-400 {
    animation-delay: 400ms;
  }
  
  .animation-delay-600 {
    animation-delay: 600ms;
  }
  
  .animation-delay-800 {
    animation-delay: 800ms;
  }
  
  .animation-delay-1000 {
    animation-delay: 1000ms;
  }
  
  /* 自定义动画 */
  .animate-float {
    animation: float 6s ease-in-out infinite;
  }
  
  .animate-pulse-slow {
    animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }
  
  .animate-bounce-slow {
    animation: bounce 3s infinite;
  }
  
  .animate-spin-slow {
    animation: spin 8s linear infinite;
  }
}

/* 关键帧动画 */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 京剧色彩专用渐变 */
.jing-gradient-zhu-shi {
  background: linear-gradient(135deg, #C41E3A 0%, #2E8B57 100%);
}

.jing-gradient-shi-mo {
  background: linear-gradient(135deg, #2E8B57 0%, #1A1A1A 100%);
}

.jing-gradient-zhu-mo {
  background: linear-gradient(135deg, #C41E3A 0%, #1A1A1A 100%);
}

.jing-gradient-gold-zhu {
  background: linear-gradient(135deg, #DAA520 0%, #C41E3A 100%);
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* 动画类 */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

.animate-rotate-in {
  animation: rotateIn 0.8s ease-out;
}
